package com.example.h2111aguyipu.controller;

import com.example.h2111aguyipu.pojo.User;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {
//    无参数
    @RequestMapping("hello")
    public String hello(){
        return "hello 顾一埔的第一个SpringBoot";
    }
    //有参
    @RequestMapping("two")
    public String two(@RequestParam("we") String name){
        return "欢迎"+name;
    }
    @RequestMapping("three")
    public String three(@RequestBody User user){

        return "核酸结果:"+user.getName()+";"+user.getResult();
    }

    @RequestMapping("four/{name}/{age}")
    public String four(@PathVariable("name") String name,@PathVariable("age") String age){

        return "欢迎"+name+ "->>"+age;
    }

}
